find all possible paths in a graph